<!DOCTYPE HTML>
<html>

<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no" />
    <title></title>
    <meta name="keywords" content="智辉CRM">
    <meta name="description" content="智辉CRM">
    <link rel="Bookmark" href="favicon.ico">
    <link rel="Shortcut Icon" href="favicon.ico" />
    <!--[if lt IE 9]> 
    <script type="text/javascript" src="Lib/html5.js"></script>
    <script type="text/javascript" src="Lib/respond.min.js"></script>
    <script type="text/javascript" src="Lib/PIE_IE678.js"></script>
    <![endif]-->
    <link href="__PUBLIC__/css/H-ui.css" rel="stylesheet" type="text/css" />
    <link href="__PUBLIC__/lib/Hui-iconfont/1.0.6/iconfont.css" rel="stylesheet" type="text/css" />
    <link href="__PUBLIC__/css/style.css" rel="stylesheet" type="text/css" />
    <!--自己的样式-->
    <link href="Tpl/Assistant/common/expense/expense_lst.css" rel="stylesheet" type="text/css">
    <link href="Tpl/Service/common/order/page01.css" rel="stylesheet" type="text/css" />
    <!--[if IE 6]> 
    <script type="text/javascript" src="Lib/DD_belatedPNG_0.0.8a-min.js" ></script>
    <script>DD_belatedPNG.fix('.pngfix,.icon');</script> 
    <![endif]-->
</head>

<body>
    <input type="hidden" id="idd" name="id" value="{$Think.session.authId}"/>
    
    <!--导航-->
    <div id="nav">
        <div class="navbox">
            <ul>
                 <a href="{:U('Expense/add',array('room_id'=>$v['id']))}"><li class=""><i class="Hui-iconfont">&#xe6b6;</i>添加缴费项目</li></a>
                <a href="{:U('Expense/lst',array('room_id'=>$v['id']))}"><li class="active1"><i class="Hui-iconfont">&#xe667;</i>费用列表</li></a>
                <a href="{:U('Account/lst',array('room_id'=>$v['id']))}"><li class=""><i class="Hui-iconfont">&#xe6e0;</i>账单列表</li></a>
                <a href="{:U('Account/logLst',array('room_id'=>$v['id']))}"><li class=""><i class="Hui-iconfont">&#xe63a;</i>缴费记录</li></a>
            </ul>
                
        </div>
    </div>
    
    <!--内容-->
    <div class="row pad">
        <div class="col-12"><span style="font-size:16px;">房间列表</span></div>
        <div class="col-12"><span style="font-size:12px;color:grey">选择房间之后，进行费用设置。</span></div>
    </div>
    <form method="post" id="communication">
        <select name="community_id" id="xiaoqu" class="xiaoqu">
            <option selected="true" value="">选择小区</option>
        </select>
        <select name="zone_id" id="quyu" class="quyu">
            <option selected="true" value="">选择园区</option>
        </select>
        <select name="building_id" id="louhao" class="louhao">
            <option selected="true" value="">选择楼号</option>
        </select>
        <select name="unit_id" id="danyuan" class="danyuan">
            <option selected="true" value="">选择单元</option>
        </select>
        <select name="room_id" id="fangjian" class="fangjian">
            <option selected="true" value="">选择房间</option>
        </select>
        <select name="year" id="year">
            <option value="">选择年度</option>
            <volist name='year' id='v'>
                <option value="{$v.value}">{$v.text}</option>
            </volist>
        </select>
        <select name="status" id="status">
            <option value="">缴费状态</option>
            <option value="1">已经缴纳</option>
            <option value="0">还未缴纳</option>
        </select>
        <select name="is_edit" id="">
            <option value="">账单状态</option>
            <option value="0">已生成</option>
            <option value="1">未生成</option>
        </select>
        <!--<input type="button" id="have_account" class="btn btn-primary-outline radius btn_h" value="批量生成账单" >-->
        <input type="submit"  class="f-r btn btn-primary-outline radius btn_h"  value="搜索">
        <input type="text" name="key" placeholder="输入姓名、手机号搜索"  class="f-r text_h input-text">
    </form>
    <!-- <div class="xian"></div> -->
    <table class="table table-border table-bordered table-bg" id="pay">
        <thead>
            <tr>
                <th>房间</th>
                <th>责任户主</th>
                <th>户主手机</th>
                <th>缴费项目名称</th>
                <th>年度</th>
                <th>缴费截止</th>
                <th>需缴金额</th>
                <th>状态</th>
                <th>是否生成账单</th>
                <th>操作</th>
            </tr>
        </thead>
        <tbody>
            <volist name="data" id="v">
            <tr>
                <td>{$v.room_name}</td>
                <td>{$v.payer_name}</td>
                <td>{$v.payer_phone}</td>
                <td>{:getDicName('expenseType',$v['type'])}</td>
                <td>{$v.year}</td>
                <td>{$v['close_time']|date="Y.m.d",###}</td>
                <td>{$v.money}</td>
                <td>{$v['status']?'已缴纳':'未缴纳'}</td>
                <td>{$v['is_edit']?'未生成':'已生成'}</td>
                <td>

                <if condition="$v['is_edit']==1">
                    <a href="{:U('Expense/delete',array('id'=>$v['id'],'room_id'=>$v['room_id']))}"><input type="button" class="btn btn-secondary-outline radius width_btn" onClick="return confirm('确认要删除？')"  value="删除"></a>
                    <a href="javascript:to3('{:U('Expense/edit',array('id'=>$v['id'],'room_id'=>$v['room_id']))}');"><input type="button" class="btn btn-secondary-outline radius width_btn" value="编辑"></a>
                    <a href="javascript:to('{:U('Expense/adding',array('room_id'=>$v['room_id']))}');"><input type="button" class="btn btn-secondary-outline radius width_btn" value="管理"></a>
                <else/>
                    <a href="javascript:to5('{:U('Account/manage',array('expense_id'=>$v['id'],'room_id'=>$v['room_id']))}');"><input type="button" class="btn btn-secondary-outline radius width_btn" value="查看"></a>
                </if>
                </td>
            </tr>
            </volist>
        </tbody>
    </table>
    <div style="text-align: center;margin-top: 30px;">{$page}</div>
    
    <script type="text/javascript" src="__PUBLIC__/lib/jquery/1.9.1/jquery.min.js"></script>
    <script type="text/javascript" src="__PUBLIC__/js/H-ui.js"></script>
    
    <script src="__PUBLIC__/lib/layer/2.1/layer.js"></script>
    <script src="Tpl/Assistant/common/expense/layerui.js"></script>
    <script src="Tpl/Assistant/common/expense/liandong.js"></script>
    <script>

//        function to8(url){
//     layer.open({
//         type: 2,
//         title: '账单管理',
// //        fix:false,
//         area: ['817px', '600px'],
//         content: url
//     });

        // 全局
        var info={
            xiaoquId:0,
            quyuId:0,
            louhaoId:0,
            danyuanId:0
        };
        $(function(){
            work.init();
        });

$(document).on("click","#have_account",function(){
            if(window.confirm('是否批量生成账单？请谨慎操作！！')){
            var community_id = $("#xiaoqu").val();
            var zone_id = $("#quyu").val();
            var building_id = $("#louhao").val();;
            var unit_id = $("#danyuan").val();
            var room_id = $("#fangjian").val();
            var year = $("#year").val();
            var url='/index.php?m=Assistant&c=Account&a=createAll&community_id='+community_id+'&zone_id='+zone_id+'&building_id='+building_id+'&unit_id='+unit_id+'&room_id='+room_id+'&year='+year;
            window.location.href = url;
            }else{
         return false;
                }
        });
      

    </script>
</body>

</html>

